<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    

    <script>
        
        // 严格模式下，var定义的变量不提升
        // "use strict";

        // 测试var的变量提升
        function add(a, b){
            sum = a + b;
            return sum;
        }
        console.log(add(1, 2))
        console.log(sum)

        
    </script>

</body>
</html>